package Day2_07_23;
import java.util.Scanner;

public class Money {
	public static void show() {
		System.out.println("欢迎使用不智能收款程序！");
		Scanner sc = new Scanner(System.in);
		System.out.println("请输入物品价格：");
		double price = sc.nextDouble();
		System.out.println("请输入物品数量：");
		double num = sc.nextDouble();
		double sum = price * num;
		if (sum > 500) {
			sum *= 0.8;
		}
		System.out.println("应收金额：" + sum + "元");
		System.out.println("请输入交入的钱数：");
		double money = sc.nextDouble();
		if (money > sum) {
			sum = money - sum;
			System.out.println("找零：" + sum + "元");
			System.out.println("谢谢惠顾,欢迎下次光临");
		} else if (money == sum) {
			System.out.println("找零：0元,谢谢惠顾,欢迎下次光临");
		} else {
			sum = sum - money;
			System.out.println("还差" + sum + "元");
			System.out.println("没钱还来购物!留下打扫卫生吧！");
		}
	}
}